package com.qisu.converters;

import com.qisu.util.ByteArrayUtils;

/**
 *
 * @author alsan
 *
 */
public final class SmallEndianLongConverter implements FieldConverter<Long> {

	@Override
	public Long converter(byte[] data, int pos, int len) {
		if(null != data && data.length >= 8) {
			return ByteArrayUtils.getLong(data, pos, len, false);
		}
		return 0L;
	}

	@Override
	public Long converter(byte[] data) {
		return converter(data, 0, 8);
	}

}
